/**
 * 
 */
package hr.fer.zemris.rznu.model.user;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import hr.fer.zemris.rznu.model.dto.user.AddressDTO;

/**
 * @author Dajan
 *
 */
@Embeddable
public class Address {
	
	@Column(name="address",length=50,nullable=true)
	private String address;
	/**
	 * Current address number.
	 */
	@Column(name="addressNumber",length=50,nullable=true)
	private String addressNumber;
	/**
	 * Town.
	 */
	@Column(name="town",length=50,nullable=true)
	private String town;
	/**
	 * Post number.
	 */
	@Column(name="postNumber",length=50,nullable=true)
	private String postNumber;
	/**
	 * Country.
	 */
	@Column(name="country",length=50,nullable=true)
	private String country;
	
	public Address() {
		// TODO Auto-generated constructor stub
	}

	public Address(String address, String addressNumber, String town,
			String postNumber, String country) {
		super();
		this.address = address;
		this.addressNumber = addressNumber;
		this.town = town;
		this.postNumber = postNumber;
		this.country = country;
	}
	
	public Address(AddressDTO addressDTO){
		
		this.address = addressDTO.getAddress();
		this.addressNumber = addressDTO.getAddressNumber();
		this.country = addressDTO.getCountry();
		this.postNumber = addressDTO.getPostNumber();
		this.town = addressDTO.getTown();
		
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAddressNumber() {
		return addressNumber;
	}

	public void setAddressNumber(String addressNumber) {
		this.addressNumber = addressNumber;
	}

	public String getTown() {
		return town;
	}

	public void setTown(String town) {
		this.town = town;
	}

	public String getPostNumber() {
		return postNumber;
	}

	public void setPostNumber(String postNumber) {
		this.postNumber = postNumber;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}
	
	
}
